knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

library(tidyverse)
library(EveryCityCanada)

How to use EveryCityCanada

As input we need a city as returned by cancensus list_census_regions.

cities=not_tweeted_cities_list()
city <- dplyr::sample_n(cities,1)
paste0(city$name," (",city$municipal_status,"), Population: ",scales::comma(city$pop))

Plotting the city card

To get the plot for the city we call the every_city_plot function. Gathering the data and drawing the vector map can take a little bit of time.

image_path=every_city_plot(city)
browseURL(image_path)

Tweeting

To tweet out a random city use the send_every_city_tweet function. Optionally specify the city to send out a tweet for a specific city.

send_every_city_tweet(city,tweeted_cities_path=file.path("..","data","tweeted_cities"))


mountainMath/every_city_canada documentation built on Feb. 25, 2020, 5:02 a.m.